home *** CD-ROM | disk | FTP | other *** search
- Path: phoenix.owl.de!not-for-mail
- Newsgroups: comp.sys.amiga.programmer
- References: <4ikpqk$ds@serpens.rhein.de>
- From: "Frank Wille" <frank@phoenix.owl.de>
- Date: Thu, 21 Mar 1996 14:38:23 +0200
- X-NewsReader: IntuiNews 1.3b Beta 3 (5.11.95)
- Subject: Re: FPU: What am I doing wrong???
- Message-ID: <42116663@phoenix.owl.de>
-
- Michael van Elst wrote on 18 Mar 1996 23:58:28 +0100
- about "FPU: What am I doing wrong???" :
-
-
- MvE> I'm posting this for Chuck Davis
- MvE> (roshicorp@roshi.corp.earthlink.net),
- MvE> please reply to him directly.
- MvE> ____________________________________________________________________
- MvE>
- MvE>
- MvE> I wonder if you might know what's happening that I don't seem to
- MvE> understand? This is my first experience in trying to use the FPU.
- MvE> The DFT routines are three versions of the same thing.
- MvE> I'm using PhxAss for all three assemblies.
- MvE>
- MvE> CPU 68030
- MvE> FPU
- MvE>
- MvE> The first version works but, of course, is too slow as it is
- MvE> used in an _interrupt_ routine and each interrupt is 8ms.
- MvE> 128 sample/sec. This used the ascii version of the sin/cos
- MvE> routines converted for FFP.
- MvE>
- MvE> In the second routine, I'm trying to get at the FPU via the IEEE
- MvE> libraries. Immediate crash! Guru# 8000 000D ???
- MvE>
- MvE> In the third routine, I'm trying to use pure FPU code. Of course,
- MvE> this would be the most ideal routine to use. Again GURU# 8000 000D
- MvE>
- MvE> [...]
-
- I already replied to Chuck directly, but this is an interesting
- problem:
-
- Does Amiga OS support accessing the FPU in interrupts?
-
- Any experts on this topic?
-
- When switching tasks, the OS saves the whole internal FPU state of
- the active task on its stack and restores the FPU state of the new
- task. But what about interrupts? I can't remember that the FPU
- state is saved by the OS before entering an interrupt handler.
-
- So maybe the interrupt routine using the FPU should look like this?
-
- ---8<---
- fsave -(sp)
- fmovem.x fp0-fp7,-(sp)
- fmovem.l fpsr/fpcr/fpiar,-(sp)
- ; ...
- ; FPU instructions
- ; ...
- fmovem.l (sp)+,fpsr/fpcr/fpiar
- fmovem.x (sp)+,fp0-fp7
- frestore (sp)+
- ---8<---
-
-
- -- _
- _ // Frank EMail: frank@phoenix.owl.de
- \X/ IRC: Phx @ #amiga(ger)
-
-